package com.ruoyi.framework.web.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.SysAppBookchapters;
import com.ruoyi.system.domain.SysAppBookinfo;
import com.ruoyi.system.service.ISysAppBookchaptersService;
import com.ruoyi.system.service.ISysAppBookinfoService;

@Service("bookinfo")
public class BookInfoService {
	
	@Autowired
    private ISysAppBookinfoService sysAppBookinfoService; 
	
	@Autowired
    private ISysAppBookchaptersService sysAppBookchaptersService;
	
	public List<SysAppBookinfo> getInfos(Integer bookStatus) {
		SysAppBookinfo sysAppBookinfo = new SysAppBookinfo();
    	sysAppBookinfo.setBookStatus(bookStatus);
    	List<SysAppBookinfo> infos = sysAppBookinfoService.selectSysAppBookinfoList(sysAppBookinfo);
		return infos;
	}
	
	public Integer getNode(Integer deptId) {
		SysAppBookchapters sysAppBookchapters = new SysAppBookchapters();
		Long id = Long.parseLong(deptId.toString());
		sysAppBookchapters.setParentId(id);
		int i = sysAppBookchaptersService.selectSysAppBookchaptersCount(sysAppBookchapters);
		return i;
	}
	
	

}
